<?php 	

	$val = isset($_GET['ID'])?$_GET['ID']:'error';

   	$ch = curl_init();
    $url = 'http://apis.baidu.com/apistore/idservice/id?id='.$val;
    $header = array(
        'apikey: e821ffde237b29e45e118a2f3a13fe8d',
    );
    curl_setopt($ch, CURLOPT_HTTPHEADER  , $header);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch , CURLOPT_URL , $url);
    $res = curl_exec($ch);

    function object_array($array) {  
	    if(is_object($array)) {  
	        $array = (array)$array;  
	     } if(is_array($array)) {  
	         foreach($array as $key=>$value) {  
	            $array[$key] = object_array($value);  
	        }  
	     }  
	     return $array;  
	}
	print_r(object_array($res));
 ?>